package it.pir.es05ChatTCP_TLS;

import java.io.*;
import java.net.*;

//Classe astratta che viene specializzata da clientObj, clientTxt o da clientBin
public abstract class Client implements Runnable {

	protected String nickname;
	protected static String address;
	protected int port;
	protected Socket socket;
	protected Message reply;
	
	@SuppressWarnings("static-access")
	public Client(String nickname, String address, int port) throws UnknownHostException, IOException {
		this.nickname = nickname;
		this.address = address;
		this.port = port;
		connect();
	}
	
	public Message getReply() {
		return reply;
	}

	protected abstract void connect() throws IOException;
	
	public abstract void sendMessage(Message message) throws IOException;

}
